package cn.edu.njuit.children.mapper;

import cn.edu.njuit.children.entity.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author Administrator
* @description 针对表【sys_role】的数据库操作Mapper
* @createDate 2022-11-29 08:58:00
* @Entity cn.edu.njuit.children.entity.Role
*/
@Mapper
public interface RoleMapper extends BaseMapper<Role> {

    @Select("SELECT\n" +
            "\tb.* \n" +
            "FROM\n" +
            "\tsys_user_account a,\n" +
            "\tsys_role b,\n" +
            "\tsys_user_role c \n" +
            "WHERE\n" +
            "\ta.phone = \"${phone}\" \n" +
            "\tAND a.id = c.user_id \n" +
            "\tAND b.id = c.role_id")
    List<Role> findByPhone(String phone);
}




